<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/layer.js"></script>
	<script src="${ctxStatic}/js/style.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <style type="text/css">
     /* No  */
    .table-No{width: 50px}
    /* 装箱单号  */
    .table-zxdh{width: 90px}
    /* 款号  */
    .table-kh{width: 90px}
    /* 款式名称  */
    .table-ksmc{width: 90px}
    /* 合同编号  */
    .table-htbh{width: 90px}
    /* 款式图片  */
    .table-kstp{width: 100px}
    /* 款号/款式名称   */
    .table-khksmc{width: 100px}
    /* 合同订单号  */
    .table-htddh{width: 90px}
    /* 包装类别  */
    .table-bzlb{width: 90px}
    /* 箱数   */
    .table-xs{width: 90px}
    /* 件数  */
    .table-js{width: 90px}
    /* 毛重  */
    .table-mz{width: 90px}
    /* 体积  */
    .table-tj{width: 90px}
  </style>
  
  
     <script>
    $(document).ready(function(){
    	searchListForm();
    });
    
   
   // 检索方法
	function searchListForm() {
		var params = $("#searchForm").serialize();
		$.post("${ctx}/consignment/note/searchPackingList",params,function(result) {
					var listHtml = result["packageCustom"];
					var pageHtml = result["page"];
					$("#listHtml").html(listHtml);
					$("#paging").html(pageHtml);
				}, 'json');
	}
   
	
   
	
	/* 选择箱单  */
	function selectPacking(){
		//获取 iframe 数量 
    	var frLength = window.parent.frames.length;
    	//父画面下标 
    	var parentIndex = frLength-2;
    	var arr =  $("#listHtml").find(".trSelected");
    	var idStr = "";
    	$.each(arr, function(i, item){
    		idStr += $(item).find(".packageId").val() + ",";
    	});
   		window.parent.frames[parentIndex].strHtml(idStr);
   		closeWin(); 
    }
    
   

            
   
    //选择按钮事件
    function selectFunction(obj){
    	// 判断是否被选中
    	var bolSelected = $(obj).hasClass("trSelected");
    	if (bolSelected) {
    		$(obj).removeClass("trSelected");
    	} else {
    		$(obj).addClass("trSelected");
    	}
    }
    
   
    
	 //重置
	function clean() {
		 $("#packageNo").val("");
		 $("#deliveryDate").val("");
		 searchListForm();
	}    
	 
	
    </script>
</head>
<body>
<form id="searchForm">
<div id="createHead" class="layerHeader clearfix" style="width: 950px">
	<p class="headerTitle"><spring:message code="Choose_packing_list" /></p>
	<div class="headerButton clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
                <button type="button" onclick="selectPacking();"><spring:message code="style_selectOK" /></button>
                <button type="button" onclick="closeWin();"><spring:message code="btn_cancle" /></button>
    </div>
</div>
<div id="showHtml" class="listArea" style="width: 950px;height: 480px;">
<input type="hidden" id="ognizationId" name="ognizationId" value="${packageCustomEntity.ognizationId }"/>
	<div class="listBg">
	    <div class="searchArea clearfix">
            <div class=" clearfix">
                <div class="searchInp clearfix">
                <!-- 发货日期 -->
                    <p><spring:message code="consignmentNote_targetDate"/></p>
                    <input type="text" id="deliveryDate" name="deliveryDate"/>
                </div>
                <div class="searchInp clearfix">
                <!-- 装箱单号 -->
                    <p><spring:message code="consignmentNote_PackinglistNo"/></p>
                    <input type="text" id="packageNo" name="packageNo"/>
                </div>
            </div>
        </div>
	
        <div class="tableArea tabBoxSm" style="height: 375px;" >
            <div class="tableScrollSm" style="overflow: auto;height: 370px;width:910px;">
                <table cellpadding="0" class="tableHead " >
                    <thead>
                    <tr>
                        <!-- No -->
                        <th><p class="table-No"><spring:message code="consignmentNote_no"/></p></th>
                        <!-- 装箱单号 -->
                        <th><p class="width-200px"><spring:message code="consignmentNote_PackinglistNo"/></p></th>
                        <!-- 交货日期-->
                        <th><p class="width-120px"><spring:message code="consignmentNote_targetDate"/></p></th>
                        <!-- 总箱数 -->
                        <th><p class="width-120px"><spring:message code="consignmentNote_numberofcases"/></p></th>
                        <!-- 总数量 -->
                        <th><p class="width-120px"><spring:message code="consignmentNote_number"/></p></th>
                        <!-- 总毛重 -->
                        <th><p class="width-120px"><spring:message code="consignmentNote_grossweight"/></p></th>
                        <!-- 总体积 -->
                        <th><p class="width-120px"><spring:message code="consignmentNote_volume"/></p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody" >              
                    <tbody id = "listHtml">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id = "paging" ></div>
</div>
</form>
</body>
</html>